import { RouteRecordRaw } from 'vue-router'
import Index from '@/views/dashboard/index.vue'
// 默认路由 所有用户共享
export const defaultRoutes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'admin',
    component: () => import('@/core/layouts/index.vue'),
    meta: {
      title: '首页',
    },
  },
  {
    path: '/login',
    component: () => import('@/components/login/index.vue'),
    meta: {
      title: '登录页',
    },
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('@/components/404/index.vue'),
    meta: {
      title: '页面丢失了~',
    },
  },
]

// 动态路由，用于匹配菜单动态添加路由
export const asyncRoutes = [
  {
    path: '/',
    name: '/',
    component: Index,
    meta: {
      title: '后台首页',
    },
  },
  {
    path: '/goods/list',
    name: '/goods/list',
    component: () => import('@/views/goods-manage/goods/index.vue'),
    meta: {
      title: '商品管理',
    },
  },
  {
    path: '/category/list',
    name: '/category/list',
    component: () => import('@/views/goods-manage/category/index.vue'),
    meta: {
      title: '分类列表',
    },
  },
  {
    path: '/user/list',
    name: '/user/list',
    component: () => import('@/views/user-manage/user/index.vue'),
    meta: {
      title: '用户列表',
    },
  },
  {
    path: '/order/list',
    name: '/order/list',
    component: () => import('@/views/order-manage/order/index.vue'),
    meta: {
      title: '订单列表',
    },
  },
  {
    path: '/comment/list',
    name: '/comment/list',
    component: () => import('@/views/order-manage/comment/index.vue'),
    meta: {
      title: '评价列表',
    },
  },
  {
    path: '/image/list',
    name: '/image/list',
    component: () => import('@/views/other/image/index.vue'),
    meta: {
      title: '图库列表',
    },
  },
  {
    path: '/notice/list',
    name: '/notice/list',
    component: () => import('@/views/other/notice/index.vue'),
    meta: {
      title: '公告列表',
    },
  },
  {
    path: '/setting/base',
    name: '/setting/base',
    component: () => import('@/views/system-manage/base.vue'),
    meta: {
      title: '配置',
    },
  },
  {
    path: '/coupon/list',
    name: '/coupon/list',
    component: () => import('@/views/goods-manage/coupon/index.vue'),
    meta: {
      title: '优惠券列表',
    },
  },
  {
    path: '/manager/list',
    name: '/manager/list',
    component: () => import('@/views/administrator-manage/manager/index.vue'),
    meta: {
      title: '管理员管理',
    },
  },
  {
    path: '/access/list',
    name: '/access/list',
    component: () => import('@/views/administrator-manage/access/index.vue'),
    meta: {
      title: '菜单权限管理',
    },
  },
  {
    path: '/role/list',
    name: '/role/list',
    component: () => import('@/views/administrator-manage/role/index.vue'),
    meta: {
      title: '角色管理',
    },
  },
  {
    path: '/skus/list',
    name: '/skus/list',
    component: () => import('@/views/goods-manage/skus/index.vue'),
    meta: {
      title: '规格管理',
    },
  },
  {
    path: '/level/list',
    name: '/level/list',
    component: () => import('@/views/user-manage/level/index.vue'),
    meta: {
      title: '会员等级',
    },
  },
  {
    path: '/setting/buy',
    name: '/setting/buy',
    component: () => import('@/views/system-manage/buy.vue'),
    meta: {
      title: '支付设置',
    },
  },
  {
    path: '/setting/ship',
    name: '/setting/ship',
    component: () => import('@/views/system-manage/ship.vue'),
    meta: {
      title: '物流设置',
    },
  },
  {
    path: '/distribution/index',
    name: '/distribution/index',
    component: () =>
      import('@/views/distribution-manage/distribution/index.vue'),
    meta: {
      title: '分销员管理',
    },
  },
  {
    path: '/distribution/setting',
    name: '/distribution/setting',
    component: () =>
      import('@/views/distribution-manage/distribution/setting.vue'),
    meta: {
      title: '分销设置',
    },
  },
]
